! Build:
! # as86 -0 -a -o boot0.o boot0.s
! # ld86 -0 -s -o boot0 boot0.o
! There are additional 32 bytes of minix file header, use dd to remove them:
! # dd if=boot0 of=boot0.img bs=32 skip=1

BOOTSEG = 0x07c0                ! BIOS load boot code to 0000:0x7c00

entry start                     ! Start from "start" label

start:
        jmpi    go, BOOTSEG     ! Set cs from 0 to 0x07c0
go:
        mov     ax, cs
        mov     ds, ax          ! Set ds, for easier addressing
        mov     es, ax          ! Set es, int 0x10 relies on es:bp for offset of a string
        mov     [msg+16], ah    ! Replace last dot with 0x7, say BEL
        mov     cx, #19         ! Display 19 characters, including CR and LF
        mov     dx, #0x1004     ! Display string at line 17, column 5
        mov     bx, #0x000c     ! Display string with red
        mov     bp, #msg
        mov     ax, #0x1301
        int     0x10            ! Call BIOS interruption 10h, with function 13h, sub-function 1h
loop0:
        jmp     loop0           ! Infinite loop
msg:
        .ascii "Loading system..."
        .byte 13, 10
        .org 510                ! Subsequent code start at address 510(0x1fe)
        .word 0xaa55            ! Boot sector signature, for BIOS usage

